package demo4.controller;

import demo4.mapper.IUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Scanner;

@Component
public class UserController {
    @Autowired
    private IUserMapper userMapper;
    public void start(){
        System.out.println("请选择对应的操作，输入序号：");
        System.out.println("1.注册,2.登录,3.再说");
        Scanner scanner =new Scanner(System.in);
        int num = Integer.parseInt(scanner.nextLine());
        switch (num){
            case 1:
                regUser();
                break;
            case 2:
                loginUser();
                break;
            default:
                System.out.println("其他功能完善中，目前404");
                break;
        }
    }
    public   void regUser(){
        System.out.println("开始处理用户注册");
        userMapper.insert(null);
    }
    public   void loginUser(){
        System.out.println("开始处理用户登录");
    }
}
